class {{ name.upper_camel_case }}(Enum):
    """
 {{ indent(enum_description, 1) }}

     Values
     ------
     {% for value in values -%}
     {{ value.name.uppercase }}
         {{ value.description }}
     {% endfor -%}
   """

    {% for value in values %}
    {{ value.name.uppercase }} = {{ loop.index - 1 }}
    {%- endfor %}

    def translate_to_rpc(self):
        {%- for value in values %}
        if self == {% if parent_struct is not none %}{{ parent_struct.upper_camel_case }}.{% endif %}{{ name.upper_camel_case }}.{{ value.name.uppercase }}:
            return {{ plugin_name.lower_snake_case }}_pb2.{% if parent_struct is not none %}{{ parent_struct.upper_camel_case }}.{% endif %}{{ name.uppercase }}_{{ value.name.uppercase }}
        {%- endfor %}

    @staticmethod
    def translate_from_rpc(rpc_enum_value):
        """ Parses a gRPC response """
        {%- for value in values %}
        if rpc_enum_value == {{ plugin_name.lower_snake_case }}_pb2.{% if parent_struct is not none %}{{ parent_struct.upper_camel_case }}.{% endif %}{{ name.uppercase }}_{{ value.name.uppercase }}:
            return {% if parent_struct is not none %}{{ parent_struct.upper_camel_case }}.{% endif %}{{ name.upper_camel_case }}.{{ value.name.uppercase }}
        {%- endfor %}

    def __str__(self):
        return self.name
